/**
 * 响应式布局样式
 * 功能：定义不同屏幕尺寸下的布局规则
 * 作者：Assistant
 * 创建时间：2025-01-15
 */

/* 基础响应式断点 */
:root {
  --breakpoint-xs: 480px;
  --breakpoint-sm: 768px;
  --breakpoint-md: 1024px;
  --breakpoint-lg: 1200px;
  --breakpoint-xl: 1440px;
}

/* 容器最大宽度 */
.container {
  width: 100%;
  margin: 0 auto;
  padding: 0 16px;
}

@media (min-width: 768px) {
  .container {
    padding: 0 24px;
  }
}

@media (min-width: 1024px) {
  .container {
    max-width: 1200px;
    padding: 0 32px;
  }
}

@media (min-width: 1440px) {
  .container {
    max-width: 1400px;
  }
}

/* 主布局响应式 */
.main-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

@media (min-width: 768px) {
  .main-layout {
    flex-direction: row;
  }
}

/* 导航栏响应式 */
.header-nav {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--el-bg-color);
  border-bottom: 1px solid var(--el-border-color);
}

.nav-menu {
  display: none;
}

@media (min-width: 768px) {
  .nav-menu {
    display: flex;
  }
}

.mobile-menu-button {
  display: block;
}

@media (min-width: 768px) {
  .mobile-menu-button {
    display: none;
  }
}

/* 侧边栏响应式 */
.sidebar {
  width: 100%;
  order: 2;
}

@media (min-width: 768px) {
  .sidebar {
    width: 300px;
    min-width: 280px;
    max-width: 400px;
    order: 1;
  }
}

@media (min-width: 1024px) {
  .sidebar {
    width: 320px;
  }
}

.sidebar.collapsed {
  width: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .sidebar.collapsed {
    width: 60px;
  }
}

/* 主内容区响应式 */
.main-content {
  flex: 1;
  order: 1;
  min-width: 0;
}

@media (min-width: 768px) {
  .main-content {
    order: 2;
  }
}

/* 聊天区域响应式 */
.chat-container {
  height: calc(100vh - 60px);
  display: flex;
  flex-direction: column;
}

.chat-history {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

@media (min-width: 768px) {
  .chat-history {
    padding: 24px;
  }
}

.input-area {
  padding: 16px;
  border-top: 1px solid var(--el-border-color);
  background: var(--el-bg-color);
}

@media (min-width: 768px) {
  .input-area {
    padding: 24px;
  }
}

/* 消息气泡响应式 */
.message-bubble {
  max-width: 100%;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .message-bubble {
    max-width: 80%;
  }
}

@media (min-width: 1024px) {
  .message-bubble {
    max-width: 70%;
  }
}

/* 卡片组件响应式 */
.source-card {
  margin-bottom: 12px;
}

@media (min-width: 768px) {
  .source-card {
    margin-bottom: 16px;
  }
}

/* 按钮组响应式 */
.button-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

@media (min-width: 480px) {
  .button-group {
    flex-direction: row;
    gap: 12px;
  }
}

/* 表单响应式 */
.form-item {
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .form-item {
    margin-bottom: 20px;
  }
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

@media (min-width: 768px) {
  .form-row {
    flex-direction: row;
    gap: 20px;
  }
}

/* 工具栏响应式 */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px;
}

@media (min-width: 768px) {
  .toolbar {
    gap: 12px;
    padding: 16px;
  }
}

/* 隐藏/显示工具类 */
.hidden-xs {
  display: none;
}

@media (min-width: 480px) {
  .hidden-xs {
    display: block;
  }
}

.hidden-sm {
  display: none;
}

@media (min-width: 768px) {
  .hidden-sm {
    display: block;
  }
}

.hidden-md {
  display: none;
}

@media (min-width: 1024px) {
  .hidden-md {
    display: block;
  }
}

.visible-xs {
  display: block;
}

@media (min-width: 480px) {
  .visible-xs {
    display: none;
  }
}

.visible-sm {
  display: block;
}

@media (min-width: 768px) {
  .visible-sm {
    display: none;
  }
}

/* 文字大小响应式 */
.text-responsive {
  font-size: 14px;
}

@media (min-width: 768px) {
  .text-responsive {
    font-size: 16px;
  }
}

@media (min-width: 1024px) {
  .text-responsive {
    font-size: 18px;
  }
}

/* 间距响应式 */
.spacing-responsive {
  padding: 12px;
  margin: 8px;
}

@media (min-width: 768px) {
  .spacing-responsive {
    padding: 16px;
    margin: 12px;
  }
}

@media (min-width: 1024px) {
  .spacing-responsive {
    padding: 20px;
    margin: 16px;
  }
}

/* 滚动条样式 */
.scrollbar-thin {
  scrollbar-width: thin;
  scrollbar-color: var(--el-border-color) transparent;
}

.scrollbar-thin::-webkit-scrollbar {
  width: 6px;
}

.scrollbar-thin::-webkit-scrollbar-track {
  background: transparent;
}

.scrollbar-thin::-webkit-scrollbar-thumb {
  background: var(--el-border-color);
  border-radius: 3px;
}

.scrollbar-thin::-webkit-scrollbar-thumb:hover {
  background: var(--el-border-color-darker);
}

/* 动画优化 */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* 打印样式 */
@media print {
  .no-print {
    display: none !important;
  }
  
  .sidebar {
    display: none !important;
  }
  
  .main-content {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
}